package com.yaorange.module.association.service.impl;

import com.yaorange.module.association.mapper.AssociationInfoMapper;
import com.yaorange.module.association.service.AssociationInfoService;
import com.yaorange.pojo.BsAssociation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AssociationInfoServiceImpl implements AssociationInfoService {
    @Autowired
    AssociationInfoMapper associationInfoMapper;
    @Override
    public void createInfo(BsAssociation bsAssociation) {
        if (associationInfoMapper.getOne() == null){
            bsAssociation.setDelFlag((byte) 0);
            associationInfoMapper.insertInfo(bsAssociation);
        }else {
            associationInfoMapper.updateInfo(bsAssociation);
        }
    }

    @Override
    public BsAssociation getOne() {
        return associationInfoMapper.getOne();
    }
}
